<?php
$ip			    = $_SERVER['REMOTE_ADDR'];
$ajax           = gpc_getBoolGet("ajax") || gpc_getBoolPost("ajax");
$actPost        = gpc_getStringPost("opt");
$popup          = (strpos($_SERVER['REQUEST_URI'],"/popup/")!==false)? true: false;
$page  			= gpc_getIntGet("page",1);
$page  			= gpc_getIntPost("page",$page);
$cid            = gpc_getStringPost('cid');
$titlesite      = getConfig('TitleSite');

//set timezone
@date_default_timezone_set(getConfig('TimeZoneDefault'));

UpdateOnline();
$listidcart     = gpc_getSession('listid');
$countcart      = count($listidcart);

$online         = CountOnlineNow();
$visiters       = LoadRate();


function CountOnlineNow()
{
global $language,$dbsql;
	  $timeold=time()-(60*50);
	  
	  $sql_select = "select count(cIp) as count from tblonline  where iTime>$timeold";      
      $rs=$dbsql->query($sql_select);
      $result = $dbsql->fetch_array($rs);
	  return $result["count"];
}

function LoadRate()
{
global $language,$dbsql;
	  $sql_select = "select cValue from tblconfig where cName like 'ratesite'";      
      $result     = $dbsql->query_fetch($sql_select);
      return $result['cValue'];
}
?>